<style type="text/css">
  ul.uiEditNav ul{
    padding: 6px;
    border: 1px dotted #ccc;
  }
</style>
<ul class="uiEditNav sortable">
  <?php
  $depth = 0;
  foreach ($this->items as $item) {
    $ndepth = $item['depth'];
    $k = $ndepth - $depth;
    if ($k > 0) {
      echo str_repeat('<ul class="sortable">', $k);
    } else if ($k < 0) {
      echo str_repeat('</ul>', -$k);
    }
    $depth = $ndepth;
    echo '<li>';
    echo sprintf('<li>%s [<a href="%s">edit</a>, <a href="%s">add</a>,<a href="%s">remove</a>]</li>',
            $item['label'],
            Url::build('admin/manage/navigation/item', array('edit' => $item['id'])),
            Url::build('admin/manage/navigation/item/add', array('nav' => $item['nav_id'], 'parent'=>$item['id'])),Url::build('admin/manage/navigation/item/remove', array('nav' => $item['nav_id'], 'id'=>$item['id']))
          );
  }
  echo str_repeat('</ul>', $depth);
  ?>
</ul>
<script type="text/javascript">
  $( ".sortable" ).sortable({
  revert: true,
  connectWith: '.sortable'
});
</script>